package cn.admin.spring;

import cn.admin.interceptor.LoginInterceptor;
import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

/**
 * @Author: 毛苏宇
 * @Description: You can do it!
 * @Date: Create in 14:47 2019/4/25
 */
@Configuration
//扫描注解
@ComponentScan(basePackages = {"cn.admin.spring","cn.admin.service"})
public class SpringRootConfigure {

    /**
     * Mybatis插件
     * @return
     */
    @Bean
    public PageInterceptor pageHelper(){
        return new PageInterceptor();
    }

    @Bean
    public PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver(){
        return new PathMatchingResourcePatternResolver();
    }

    @Bean
    public LoginInterceptor loginInterceptor(){
        return new LoginInterceptor();
    }

}
